home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1980-05-17 | 1.0 KB | 32 lines |
- Rem In a similar manner to the first Bob collision example,you control
- Rem a Bob on screen with the joystick,but this time,we have several
- Rem Bobs on screen,and test for collisions between Bob 1 and bobs 2 to 4.
- Rem This way allows us to test for a collision between one Bob and a range
- Rem of others.
- Rem In the line:If Bob Col(1,2 To 4)then etc...
- Rem the first number is the bob we want to check for collisions
- Rem with the others,in this case its Bob 1,the next number(2) is the
- Rem start of the range of Bobs we are checking collisions with,so we
- Rem obviously start with the lowest nuber,then we write "To" and then the
- Rem last nuber in the range of Bobs we are checking(In this case 4).
- Screen Open 0,320,256,16,Lowres
- Flash Off
- Curs Off
- Cls 0
- Load "ATTBG:JUMP.Abk"
- Get Sprite Palette
- Double Buffer
- X=150
- Y=110
- Bob 2,20,50,3
- Bob 3,190,50,3
- Bob 4,190,200,3
- Bob 5,20,200,2
- Do
- If Joy(1)=1 Then Y=Y-1
- If Joy(1)=2 Then Y=Y+1
- If Joy(1)=4 Then X=X-1
- If Joy(1)=8 Then X=X+1
- If Bob Col(1,2 To 4) Then Print At(10,10);"COLLISION DETECTED"
- Bob 1,X,Y,1
- Loop